--[[--
		文件 : eamil.lua
		功能 : 邮件协议  1000 -1999
--]]--

local M = {}

M.types = [[

.item {
	id 0 : integer

}

.mail {
	char_id 0 : integer
	mail_id 1 : integer
}

.mail_message {
	
	id 0 : integer
	send_id 1 : integer
	send_name 2 : string
	dest_id 3 : integer
	dest_name 4 : string
	title 5 : string
	body 6 : string
	mail_status 7 : integer
	timestamp 8 : integer
	gold 9 : integer
	item 10 : item
}

.mail_data {
	
	amount 0 : integer
	full 1 : boolean 
	unchecked 2 : integer
	unread 3 : integer
	mail_message 4 : *mail_message

}

]]

M.c2s = [[

parse_load_all_mail 1001 {
	
	request {
	#	char_id 0 : integer
	}

	#response {
	#	all_mail 0 : *mail_data
	#}

	response {
		str 0 : string
	}
}

parse_mail_read 1002 {

	request {
	#	mail_id 0 : integer
	}

	response {
		str 0 : string
	}
}

parse_mail_delete 1003 {

	request {
	#	delete 0 : *mail
	}

	response {
		str 0 : string
	}

}

parse_mail_send 1004 {

	request {

		#char_id 0 : integer
		#account_id 1 : integer
	}

	response {
		str 0 : string
	}
}

parse_mail_return 1005 {

	request {
		#return 0 : mail
	}

	response {
		str 0 : string
	}
}

parse_mail_getattach 1006 {

	request {
		#getattach 0 : mail
	}

	response {
		str 0 : string
	}
}

parse_mail_request_inbox 1007 {

	request {
		#char_id 0 : integer
		#flag 1 : integer 
		
	}

	response {
		str 0 : string
	}

}

parse_mail_sendmail 1008 {

	request {
		#sendmail 0 : mail_message
	}

	response {
		str 0 : string
	}
}

]]

M.s2c = [[]]

return M
